#include <cppunit/config/SourcePrefix.h>
#include "Parser_VarTableTest.h"
#include <iostream>
#include <string>
#include <sstream>
#include <fstream>
#include <stdio.h>
using namespace std;

void
Parser_VarTableTest::setUp()
{}
void
Parser_VarTableTest::tearDown()
{}

CPPUNIT_TEST_SUITE_REGISTRATION( Parser_VarTableTest );

void Parser_VarTableTest::testParser_VarTable(){
	cout << "Testing : Parser to VarTable" << endl;
	//parse the SIMPLE source code into the parser
	PKB* pkb = new PKB();
	Parser* p = new Parser(pkb);
	p->startParsing("../Release/src.txt"); 

	stringstream ss;
	
	/*// verify that VarTable is correct
	for (auto it = pkb->varTable->varTable.begin(); it != pkb->varTable->varTable.end(); ++it) {
		ss << it->first << " : " << it->second << endl;
	}
	cout << "Vartable: " << ss.str() << endl;
	CPPUNIT_ASSERT("1 : x\n2 : w\n3 : y\n4 : z\n5 : c\n6 : u\n7 : p\n8 : g\n" == ss.str());
	ss.clear();
	ss.str(" ");
	*/
	cout << "Test OK: Parser to VarTable" << endl;
}